#ifndef __ACCELEROMETER_H_
#define __ACCELEROMETER_H_

#include "common_def.h"
#include "timer_a_capture.h"

// NOTE: this is NOT executed in interrupt context.
// It's called in acc_check_completion
typedef void (*ACC_HANDLER_T)(uint16 t1, uint16 t2);

// power up accelerometer. Do not capture immediately after this function.
// We need to wait until the voltage is stablized
void acc_init(void);

// power down accelerometer.
void acc_finish(void);

void acc_start_capture(ACC_HANDLER_T handler);
void acc_check_completion(void);

#endif // __ACCELEROMETER_H_
